package ufrj.safcp.model.util;

public class IntegerOccourrence implements Comparable<IntegerOccourrence> {

	public IntegerOccourrence(Integer number) {
		this.number = number;
	}
	
	public Integer number;
	
	public Integer occourrences = Integer.valueOf(0);

	public int compareTo(IntegerOccourrence o) {
		return occourrences.compareTo(o.occourrences);
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((number == null) ? 0 : number.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		IntegerOccourrence other = (IntegerOccourrence) obj;
		if (number == null) {
			if (other.number != null)
				return false;
		} else if (!number.equals(other.number))
			return false;
		return true;
	}
	
	

}
